#ifndef FRACTION_H_
#define FRACTION_H_
#include "Integers.h" 

typedef struct {
	/* Stores number as an (irreducible) fraction.
	 * Numerator and Denominator are of Integer type,
	 * which is unsigned int, but can be replaced by multiprecision integers if needed.
	 * Do we allow Fractions with zero denominator?
	 */
	Integer p;	/*Numenator*/
	Integer q;	/*Denominator*/
	/* Numerator and denominator are called p and q respectively, because it is
	 * short and these are most frequent letters to represent them.
	 */
	 Sign sign;	//Both p and q are unsigned, so we need sign for the Fraction; true is for negative. 
} Fraction;
	
/* We should be able to manipulate with fractions. */
void fraccpy(Fraction * dest, const Fraction * src);
void inttofrac(Fraction * dest, const int src);
void linttofrac(Fraction * dest, const long long int src);
void makefrac(Fraction * dest, Integer numerator, Integer denominator, Sign sign);
void fracplus(Fraction * dest, const Fraction * first, const Fraction * second);
void fracminus(Fraction * dest, const Fraction * first, const Fraction * second);
void fracmul(Fraction * dest, const Fraction * first, const Fraction * second);
void fracdiv(Fraction * dest, const Fraction * first, const Fraction * second);
void fracopp(Fraction * dest, const Fraction * src);
void fracinv(Fraction * dest, const Fraction * src);
int fraccmp(const Fraction * first, const Fraction * second);
void fracreduce(Fraction * frac);

#endif /*FRACTION_H_*/
